<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{$pagetitle}</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/static/admin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/admin.css" media="all">
  <link rel="stylesheet" href="/static/admin/style/global.css" media="all">
  <!--select2 js start-->
  <link rel="stylesheet" href="/static/select2/select2.css" media="all">
  <!--select2 js end-->  
  <style>
	  .set-select2 .select2-container .select2-choice{ height: 36px; line-height: 36px;}
	  .set-select2 .select2-container .select2-choice .select2-arrow b{ background: url(/static/select2/select2.png) no-repeat 0 4px;}
	  .select2-results .select2-highlighted{ background: #009688;}
  </style>
</head>
<body>

	<div class="layui-fluid">
	<div class="layui-card">

	<div class="layui-card-body">
	<form class="layui-form" action="{:url('updateSort')}" method="post" onsubmit="return save_form(this)" lay-filter="component-form-element">
		<input type="hidden" name="table_name" value="{$table_name}">
	<table class="layui-table">
	  <colgroup>
		<col width="150">
		<col width="150">
		<col width="200">
		<col>
	  </colgroup>
	  <thead>
		<tr>
			<th width="3%"><input type="checkbox" value="0" class="checkall" lay-ignore></input></th>
			<th style="width:3%">cache_id</th>
			<th style="width:3%">id</th>
			<th style="width:5%">表名</th>
			<th style="width:10%">栏目</th>
			<th style="width:30%;">标题</th>
			<th style="width:10%">用户</th>
			<th style="width:10%">状态</th>
			<th style="width:10%">时间</th>
			<th style="width:20%">操作</th>
		</tr> 
	  </thead>
	  <tbody>
	  {foreach $newdata as $key=>$v}
		<tr>
			<td style="text-align: center;"><input type='checkbox' class="chekboxs" name="ids[]" lay-ignore value="{$v.cache_id}"></td>
			<td style="text-align: center;">{$v.cache_id}</td>
			<td style="text-align: center;">{$v.id}</td>
			<td style="text-align: center;">{$v.table_name}</td>
			<td style="text-align: center;">{$v.catname}</td>
			<td style="text-align: center;">{$v.title}</td>
			<td class="center">{$v.username}</td>
			{if($v['state'] == 'draft')}
			<td class="center">草搞</td>
			{elseif($v['state'] == 'readyCheck')}
			<td class="center">待审核</td>
			{elseif($v['state'] == 'notCheck')}
			<td class="center">审核不通过</td>
			{elseif($v['state'] == 'recycle')}
			<td class="center">回收站</td>
			{/if}
			<td class="center">{:date("Y-m-d H:i",$v['addtime'])}</td>
		  <td class="center">
			<a href="{:url('cache_redundancy_view',array('cache_id'=>$v['cache_id']))}" class="layui-btn layui-btn-sm iframe" title="预览"  data-width="80%" data-height="90%"><i class="layui-icon">&#xe615;</i></a>
			<a href="{:url('cache_redundancy_delete',array('ids'=>$v['cache_id']))}" class="layui-btn layui-btn-sm ajax_del"><i class="layui-icon">&#xe640;</i></a>
		  </td>
		</tr>
	   {/foreach}
	  </tbody>
	</table>
	
	<div class="layui-inline">
		<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" onclick="this_delete()">删除</button>
						
	</div> 
	<div class="listpage">{$pagelist|raw}</div>
	</form>				  
	</div>
      
	</div>
</div>

  <script src="/static/admin/layui/layui.js"></script>
  <script src="/static/js/jquery.min.js"></script>    
  <script src="/static/js/globals.js"></script>  
  
  <!--select2 js start-->
  <script src="/static/select2/select2.js"></script>
  <!--select2 js end-->
  
  <script>
  $('.select2').select2();
  layui.config({
    base: '/static/admin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'form', 'laydate'], function(){
    var $ = layui.$
    ,admin = layui.admin
    ,element = layui.element
	,laydate = layui.laydate;
    //示例代码
    
    //开始日期
    var insStart = laydate.render({
      elem: '#test-laydate-start'
      ,done: function(value, date){
        //更新结束日期的最小日期
        insEnd.config.min = lay.extend({}, date, {
          month: date.month - 1
        });
        //自动弹出结束日期的选择器
       insEnd.config.elem[0].focus();
      }
    });
    
    //结束日期
    var insEnd = laydate.render({
      elem: '#test-laydate-end'
      ,min: 0
    });

  });
  //删除
	function this_delete(){
		layer.confirm("您确定要删除吗？",function(){
			$('.layui-form').attr('action','{:url("cache_redundancy_delete")}');
			$('.layui-form').submit();
		},function(){layer.closeAll();return false;});
	}
  </script>

</body>
</html>
